const Router = require('koa-router');
const {
  getBasicSalary,
  addBasicSalary,
  editBasicSalary,
  deleteBasicSalary,
  getWorkTypeSalary,
  addWorkTypeSalary,
  editWorkTypeSalary,
  deleteWorkTypeSalary,
} = require('../controller/salary.controller');
const { verifyToken } = require('../controller/login.controller');

const salaryRouter = new Router({ prefix: '/maintainers/salary' });

// 获取基本工资组成
salaryRouter.get('/basic', verifyToken, getBasicSalary);

// 添加基本工资组成
salaryRouter.post('/basic', verifyToken, addBasicSalary);

// 修改基本工资组成
salaryRouter.put('/basic', verifyToken, editBasicSalary);

// 删除基本工资组成
salaryRouter.delete('/basic', verifyToken, deleteBasicSalary);

// 获取岗位工资数据
salaryRouter.get('/workType', verifyToken, getWorkTypeSalary);

// 添加岗位工资数据
salaryRouter.post('/workType', verifyToken, addWorkTypeSalary);

// 编辑岗位工资数据
salaryRouter.put('/workType', verifyToken, editWorkTypeSalary);

// 删除岗位工资数据
salaryRouter.delete('/workType', verifyToken, deleteWorkTypeSalary);

module.exports = salaryRouter;